<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
	<th:block th:include="include :: header('动土详情')" />
	<link rel="stylesheet" href="/libs/mui/css/mui.min.css">
	<link rel="stylesheet" type="text/css" href="/libs/mui/css/app.css" />
	<link rel="stylesheet" type="text/css" href="/libs/mui/css/mui.picker.min.css" />
	<link rel="stylesheet" type="text/css" href="/common/css/public.css">
	<link rel="stylesheet" type="text/css" href="/common/css/style.css">
	<link rel="stylesheet" type="text/css" href="/common/css/form.css">
	<link  rel="stylesheet" type="text/css"  href="/libs/webuploader/webuploader.css"/>
</head>
<body>
<div class="up_list_content">
	<!--表单start-->
	<div class="up_content_form" th:if="${index == 0}">

		<!--属地审核中-->
		<form class="up_group" id="First" th:if="${data.Status == 1}">

			<input th:value="${data.ID}" type="hidden" class="id" id="ID" name="ID">


			<div class="up_row up_btextarea">
				<label><font>*</font>审核意见</label>
				<textarea rows="5" placeholder="请输入" name="FirstAppOpinion" required></textarea>
			</div>

			<div class="up_content_button">
				<input class="up_butt tg" id="First_tg" type="button" value="通过" />

				<input class="up_butt bh" id="First_bh" type="button" value="驳回" />
				<div class="clear_both"></div>
			</div>
			<div class="up_row">
			</div>

			<div id="bh_button" style="display: none">
				<div  class="up_row record-select"  th:data="${reject}" >
					<label><font>*</font>驳回选择</label>
					<input type="text" class="record-select-data"  name="ignore4"   placeholder="请选择" required >
					<input type="hidden" class="record-select-id" name="BackType" id="BackType" value="0">
					<icon class="icon_more fright"></icon>
					<div class="clear_both"></div>
				</div>

				<div class="up_content_button"  >
					<input class="up_bubh tg"  id="First_origin" type="button" value="确定" />
					<div class="clear_both"></div>
				</div>

			</div>


		</form>

			<!--安环部审核中-->
		<form class="up_group" id="Second" th:if="${data.Status == 2}">

			<input th:value="${data.ID}" type="hidden" class="id"  name="ID">

			<div class="up_row up_btextarea">
				<label><font>*</font>审核意见</label>
				<textarea rows="5" placeholder="请输入" name="SecondAppOpinion" required></textarea>
			</div>

			<div class="up_content_button">
				<input class="up_butt tg" type="button" id="Second_tg" value="通过" />
				<input  type="hidden"   name="SecondAppResult" value="" id="news">
				<input class="up_butt bh" type="button" id="Second_bh" value="驳回" />
				<div class="clear_both"></div>
			</div>

			<div id="ahbh_button" style="display: none">
				<div  class="up_row record-select"  th:data="${reject}" >
					<label><font>*</font>驳回选择</label>
					<input type="text" class="record-select-data "  name="ignore4"   placeholder="请选择" required >
					<input type="hidden" class="record-select-id" name="BackType"  value="0">
					<icon class="icon_more fright"></icon>
					<div class="clear_both"></div>
				</div>

				<div class="up_content_button"  >
					<input class="up_bubh tg"  id="Second_origin" type="button" value="确定" />
					<div class="clear_both"></div>
				</div>

			</div>


		</form>

		<!--公司领导审核中-->
		<form class="up_group" id="Third" th:if="${data.Status == 3}">

			<input th:value="${data.ID}" type="hidden" class="id"  name="ID">

			<div class="up_row up_btextarea">
				<label><font>*</font>审核意见</label>
				<textarea rows="5" placeholder="请输入" name="ThirdAppOpinion" required></textarea>
			</div>

			<div class="up_content_button">
				<input class="up_butt tg" type="button" id="Third_tg" value="通过" />
				<input  type="hidden"   name="ThirdAppResult" id="ThirdAppResult" value="">
				<input class="up_butt bh" type="button" id="Third_bh" value="驳回" />
				<div class="clear_both"></div>
			</div>

			<div id="ldbh_button" style="display: none">
				<div  class="up_row record-select"  th:data="${reject}" >
					<label><font>*</font>驳回选择</label>
					<input type="text" class="record-select-data "  name="ignore4"   placeholder="请选择" required >
					<input type="hidden" class="record-select-id" name="BackType"  value="0">
					<icon class="icon_more fright"></icon>
					<div class="clear_both"></div>
				</div>

				<div class="up_content_button"  >
					<input class="up_bubh tg"  id="Third_origin" type="button" value="确定" />
					<div class="clear_both"></div>
				</div>
			</div>

		</form>

	</div>
	<!--表单end-->
	<!--详情内容start-->
	<div class="up_content_desc">
		<ul class="list_nav list_nav_block">
			<li>
				<div class="list_nav_top">
					<span class="list_nav_zt list_nav_zt_one fleft" th:if="${data.Status == 0}">未提交</span>
					<span class="list_nav_zt list_nav_zt_two fleft" th:if="${data.Status == 1}">生产单位负责人审批中</span>
					<span class="list_nav_zt list_nav_zt_two fleft" th:if="${data.Status == 2}">安环部负责人审批中</span>
					<span class="list_nav_zt list_nav_zt_two fleft" th:if="${data.Status == 3}">设备部负责人审批中</span>
					<span class="list_nav_zt list_nav_zt_five fleft" th:if="${data.Status == 4}">审批未通过</span>
					<span class="list_nav_zt list_nav_zt_eight fleft" th:if="${data.Status == 5}">审批通过</span>
					<span class="list_nav_time fright" th:text="'创建时间： '+${data.CreateDate}">检查时间：2019-09-08</span>
					<div class="clear_both"></div>
				</div>
				<div class="list_nav_desc">
						<font>创建人：</font>
					<span th:text="${data.CreateUserName}">***</span>
					<div class="clear_both"></div>

					<input th:value="${data.OrganizationID}" type="hidden" class="OrganizationID">
					<input th:value="${data.ID}" type="hidden" class="id">
					<input th:value="${data.ApplyUserID}" type="hidden" class="id">
					<input th:value="${data.FactoryAreaID}" type="hidden" class="id">

					<!--状态ID-->
					<input th:value="${data.Status}" type="hidden" class="id">

					<font>申请单位：</font>
					<span th:text="${data.OrganizationName}">***</span>
					<div class="clear_both"></div>

					<font>申请人：</font>
					<span th:text="${data.ApplyUserName}">***</span>
					<div class="clear_both"></div>

					<font>作业单位：</font>
					<span th:text="${data.WorkOrg}">***</span>
					<div class="clear_both"></div>

					<font>作业内容：</font>
					<span th:text="${data.WorkContent}">***</span>
					<div class="clear_both"></div>

					<font>作业区域：</font>
					<span th:text="${data.WorkPlace}">***</span>
					<div class="clear_both"></div>

					<font>开始时间：</font>
					<span th:text="${data.BeginDate}">***</span>
					<div class="clear_both"></div>

					<font>结束时间：</font>
					<span th:text="${data.EndDate}">***</span>
					<div class="clear_both"></div>


					<font>区域：</font>
					<span th:text="${data.FactoryAreaName}">***</span>
					<div class="clear_both"></div>



					<font>涉及的其他特殊作业：</font>
					<span th:text="${data.OtherTask}">***</span>
					<div class="clear_both"></div>

					<font>备注：</font>
					<span th:text="${data.Remark}">***</span>
					<div class="clear_both"></div>



					<font>状态：</font>
					<span th:text="${data.StatusName}">***</span>
					<div class="clear_both"></div>

					<font>生产单位负责人：</font>
					<span th:text="${data.FirstUserName}">***</span>
					<div class="clear_both"></div>

					<font>生产单位负责人审批结果：</font>
					<!--<span th:text="${data.FirstAppResult}">***</span>-->
					<span  th:if="${data.FirstAppResult == true}">审批通过</span>
					<span th:if="${data.FirstAppResult == false}">审批未通过</span>
					<div class="clear_both"></div>

					<font>生产单位负责人审批意见：</font>
					<span th:text="${data.FirstAppOpinion}">***</span>
					<div class="clear_both"></div>

					<font>生产单位负责人审批时间：</font>
					<span th:text="${data.FirstDate}">***</span>
					<div class="clear_both"></div>

					<font>安环部负责人：</font>
					<span th:text="${data.SecondUserName}">***</span>
					<div class="clear_both"></div>

					<font>安环部负责人审批结果：</font>
					<!--<span th:text="${data.FirstAppResult}">***</span>-->
					<span  th:if="${data.SecondAppResult == true}">审批通过</span>
					<span  th:if="${data.SecondAppResult == false}">审批未通过</span>
					<div class="clear_both"></div>

					<font>安环部负责人审批意见：</font>
					<span th:text="${data.SecondAppOpinion}">***</span>
					<div class="clear_both"></div>

					<font>安环部负责人审批时间：</font>
					<span th:text="${data.SecondDate}">***</span>
					<div class="clear_both"></div>

					<font>设备部负责人：</font>
					<span th:text="${data.ThirdUserName}">***</span>
					<div class="clear_both"></div>


					<font>设备部负责人审批结果：</font>
					<!--<span th:text="${data.FirstAppOpinion}">***</span>-->
					<span  th:if="${data.ThirdAppResult == true}">审批通过</span>
					<span  th:if="${data.ThirdAppResult == false}">审批未通过</span>
					<div class="clear_both"></div>

					<font>设备部负责人审批意见：</font>
					<span th:text="${data.ThirdAppOpinion}">***</span>
					<div class="clear_both"></div>


					<font>设备部负责人审批时间：</font>
					<span th:text="${data.ThirdDate}">***</span>
					<div class="clear_both"></div>

				</div>
			</li>
		</ul>
	</div>
	<!--详情内容end-->
	<!--流程start-->
	<div class="up_content_lcheng">
		<ul>
			<li th:each="log,index : ${logs}">
				<div class="fleft">
					<span class="list_nav_zt list_nav_zt_four" th:text="${log.name}">待复查</span>
					<!--<div class="up_lcheng_bg"><img src="images/dian.png" width="14" height="14"></div>-->
				</div>
				<div class="up_cont_lcright fright">
					<span class="fleft" th:text="${log.operateName}">姜俊雄</span>
					<font class="fright up_cont_time" th:text="${log.createdate}">12.16 09:00</font>
					<div class="clear_both"></div>
					<p th:text="${log.content}">隐患内容</p>
				</div>
				<div class="clear_both"></div>
			</li>
		</ul>
	</div>
	<!--流程end-->
</div>
</body>
<th:block th:include="include :: footer" />
<script src="/libs/mui/js/mui.min.js"></script>
<script src="/libs/mui/js/mui.picker.min.js"></script>
<script src="/libs/webuploader/webuploader.nolog.js"></script>
<script src="/common/js/form.js"></script>
<script>
    // 初始化Web Uploader
    var uploader = WebUploader.create({
        // 选完文件后，是否自动上传。
        auto: true,

        // 文件接收服务端。
        server: ctx + '/public/UpoladFiles',

        // 选择文件的按钮。可选。
        // 内部根据当前运行是创建，可能是input元素，也可能是flash.
        pick: '#filePicker',

        // 只允许选择图片文件。
        accept: {
            title: 'Images',
            extensions: 'gif,jpg,jpeg,bmp,png',
            mimeTypes: 'image/*'
        }
    });

    //回显内容
    $("#FirstUserID").val($.userOperate.userName());
    $("[name=FirstUserID]").val($.userOperate.userId());
    $("#SecondUserID").val($.userOperate.userName());
    $("[name=SecondUserID]").val($.userOperate.userId());
    $("#ThirdUserID").val($.userOperate.userName());
    $("[name=ThirdUserID]").val($.userOperate.userId());

    //属地提交通过
    $("#First_tg").click(function(){
        $("#bh_button").hide();
        if($("#news").val()==null){
            $("#First").append('<input type="hidden" name="FirstAppResult" id="news" value="true "/><br/><br/>');
		}
        if($("#news").val()=="false"){
            $("#news").val("true");
        };

        $("[name=Status]").val("0");
        console.log($.common.serializeNotNull()+"&entityName=DTEarthTask&opName=FirstApprove&userId="+$.userOperate.userId());
        var data = $("#First").serialize()+"&entityName=DTEarthTask&opName=FirstApprove&userId="+$.userOperate.userId();
        console.log(data);
        if($.validate.form()){
            $.ajax({
                url:ctx+"/public/Save",
                type:"post",
                data:data,
                dataType:"json",
                success:function (obj) {
                    if(obj.statusCode==0){
                        location.href =  "/dangerous/earthTasklist?userId="+$.userOperate.userId();
                    }else{
                        alert(obj.statusMsg);
                    }
                }
            })
        }
    });
    //属地驳回
    $("#First_bh").click(function () {

		$("#news").val("false");

		$("#bh_button").show();
    });
    //属地提交驳回到起点_BackType
    $("#First_origin").click(function(){
        if($("#news").val()==null){
            $("#First").append('<input type="hidden" name="FirstAppResult" id="news" value="false"/><br/><br/>');
        }
        if($("#news").val()=="true"){
            $("#news").val("false");
        };

        $("[name=Status]").val("0");
        console.log($.common.serializeNotNull()+"&entityName=DTEarthTask&opName=FirstApprove&userId="+$.userOperate.userId());
        var data = $("#First").serialize()+"&entityName=DTEarthTask&opName=FirstApprove&userId="+$.userOperate.userId();
        console.log(data);
        if($.validate.form()){
            $.ajax({
                url:ctx+"/public/Save",
                type:"post",
                data:data,
                dataType:"json",
                success:function (obj) {
                    if(obj.statusCode==0){
                        location.href = "/dangerous/earthTasklist?userId="+$.userOperate.userId();
                    }else{
                        alert(obj.statusMsg);
                    }
                }
            })
        }
    });


    //安环部提交
    $("#Second_tg").click(function(){
        $("#ahbh_button").hide();
        $("#news").val("true");
        $("[name=Status]").val("0");
        console.log($.common.serializeNotNull()+"&entityName=DTEarthTask&opName=SecondApprove&userId="+$.userOperate.userId());
        var data = $("#Second").serialize()+"&entityName=DTEarthTask&opName=SecondApprove&userId="+$.userOperate.userId();
        console.log(data);
        if($.validate.form()){
            $.ajax({
                url:ctx+"/public/Save",
                type:"post",
                data:data,
                dataType:"json",
                success:function (obj) {
                    if(obj.statusCode==0){
                        location.href = "/dangerous/earthTasklist?userId="+$.userOperate.userId();
                    }else{
                        alert(obj.statusMsg);
                    }
                }
            })
        }
    });
    //安环部驳回
    $("#Second_bh").click(function () {

        $("#news").val("false");

        $("#ahbh_button").show();
    });
    //安环部驳回类型
    $("#Second_origin").click(function(){
        $("#news").val("false");
        $("[name=Status]").val("0");
        console.log($.common.serializeNotNull()+"&entityName=DTEarthTask&opName=SecondApprove&userId="+$.userOperate.userId());
        var data = $("#Second").serialize()+"&entityName=DTEarthTask&opName=SecondApprove&userId="+$.userOperate.userId();
        console.log(data);
        if($.validate.form()){
            $.ajax({
                url:ctx+"/public/Save",
                type:"post",
                data:data,
                dataType:"json",
                success:function (obj) {
                    if(obj.statusCode==0){
                        location.href =  "/dangerous/earthTasklist?userId="+$.userOperate.userId();
                    }else{
                        alert(obj.statusMsg);
                    }
                }
            })
        }
    });

    //公司领导提交ldbh_button
    $("#Third_tg").click(function(){
        $("#ldbh_button").hide();
        $("#ThirdAppResult").val("true");

        console.log($.common.serializeNotNull()+"&entityName=DTEarthTask&opName=ThirdApprove&userId="+$.userOperate.userId());
        var data = $("#Third").serialize()+"&entityName=DTEarthTask&opName=ThirdApprove&userId="+$.userOperate.userId();
        console.log(data);
        if($.validate.form()){
            $.ajax({
                url:ctx+"/public/Save",
                type:"post",
                data:data,
                dataType:"json",
                success:function (obj) {
                    if(obj.statusCode==0){
                        location.href =  "/dangerous/earthTasklist?userId="+$.userOperate.userId();
                    }else{
                        alert(obj.statusMsg);
                    }
                }
            })
        }
    });
    //公司领导驳回
    $("#Third_bh").click(function () {

        $("#ThirdAppResult").val("false");

        $("#ldbh_button").show();
    });
    //公司领导驳回类型
    $("#Third_origin").click(function(){
        $("#ThirdAppResult").val("false");
        $("[name=Status]").val("0");
        console.log($.common.serializeNotNull()+"&entityName=DTEarthTask&opName=ThirdApprove&userId="+$.userOperate.userId());
        var data = $("#Third").serialize()+"&entityName=DTEarthTask&opName=ThirdApprove&userId="+$.userOperate.userId();
        console.log(data);
        if($.validate.form()){
            $.ajax({
                url:ctx+"/public/Save",
                type:"post",
                data:data,
                dataType:"json",
                success:function (obj) {
                    if(obj.statusCode==0){
                        location.href =  "/dangerous/earthTasklist?userId="+$.userOperate.userId();
                    }else{
                        alert(obj.statusMsg);
                    }
                }
            })
        }
    });


    //初始化图片上传 事件
    uploaderInit(uploader);
    //删除图片
    $(document).on("click",".file_close",function(){
        var fileDiv = $(this).parent();
        var fileId = fileDiv.attr("id");
        var imageIds = $("#imageIds").val();
        $("#imageIds").val(imagesIdsReplace(imageIds,fileDiv));
        fileDiv.remove();
        uploader.removeFile(fileId);
    });
</script>
</html>
